﻿@using WB.Core.BoundedContexts.Headquarters.WebInterview
@using WB.Core.Infrastructure.Versions
@using WB.UI.Headquarters.Code
@using WB.UI.Headquarters.Configs
@using WB.UI.Headquarters.Models.WebInterview
@using WB.Core.BoundedContexts.Headquarters.Configs
@{ Layout = null; }
@model WB.UI.Headquarters.Models.WebInterview.WebInterviewIndexPageModel
@inject IProductVersion productVersion
@inject IOptions<GoogleMapsConfig> googleMapsConfig
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web interview</title>
    <link rel='icon' sizes='192x192' href='/img/identity/favicon-hq-192x192.png'>
    <link rel='apple-touch-icon' sizes='180x180' href='/img/identity/favicon-hq-180x180.png'>
    <link rel='apple-touch-icon' sizes='152x152' href='/img/identity/favicon-hq-152x152.png'>
    <link rel='apple-touch-icon' sizes='144x144' href='/img/identity/favicon-hq-144x144.png'>
    <link rel='apple-touch-icon' sizes='120x120' href='/img/identity/favicon-hq-120x120.png'>
    <link rel='apple-touch-icon' sizes='114x114' href='/img/identity/favicon-hq-114x114.png'>
    <link rel='apple-touch-icon' sizes='76x76' href='/img/identity/favicon-hq-76x76.png'>
    <link rel='apple-touch-icon' sizes='72x72' href='/img/identity/favicon-hq-72x72.png'>
    <link rel='apple-touch-icon' href='/img/identity/favicon-hq.png'>
    <script>
        document.cookie = "_tz=" + new Date().getTimezoneOffset() + "; path=/";

        global: CONFIG = {
            basePath: '@Url.Content("~/")',
            id: '@Model.Id',
            coverPageId: '@Model.CoverPageId',
            askForEmail: @(Model.AskForEmail ?? "false"),
            sendLinkUri: '@Url.Action("EmailLink", "WebInterview")',
            virtualPath: '@Url.Content("~/WebInterview")',
            imageUploadUri: '@Url.Action("Image", "WebInterviewBinary")',
            audioUploadUri: '@Url.Action("Audio", "WebInterviewBinary")',
            imageGetBase: '@Url.Content(@"~/api/WebInterviewResources")',
            audioGet: '@Url.Content(@"~/Resource/AudioRecord")',
            signalrPath: '@Url.Content(@"~/signalr/hubs")',
            verboseLogging: false,
            supportedTransports: ["webSockets", "longPolling"],
            appVersion: '@(productVersion.ToString())',
            googleApiKey: '@(googleMapsConfig.Value.ApiKey)',
            googleMapsApiBaseUrl: '@googleMapsConfig.Value.ApiBaseUrl',
            googleMapsBaseUrl: '@googleMapsConfig.Value.BaseUrl',
            hqLink : @Html.Raw(this.User.Identity.IsAuthenticated && this.User.IsInRole("Interviewer")
                         ? "'" + Url.Content(@"~/InterviewerHq/Started") + "'"
                         : "null"),
            customTexts: {
                completeButton: '@Html.ToSafeJavascriptMessage(Model.CustomMessages.GetText(WebInterviewUserMessages.CompleteButton).ToString())',
                noteToSupervisor: '@Html.ToSafeJavascriptMessage(Model.CustomMessages.GetText(WebInterviewUserMessages.CompleteNoteToSupervisor).ToString())'
            },
            mayBeSwitchedToWebMode: @(Model.MayBeSwitchedToWebMode ? "true" : "false"),
            webInterviewUrl: '@Model.WebInterviewUrl'
        }
    </script>
    <locale component="webinterview"></locale>
</head>
<body class="gray-background wide-navbar">
   
    <div id="app"></div>
</body>
</html>
